<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ include file="../../common/init.jsp"%>
<%@page import="com.gopay.remote.solution.vo.PayChannelDtlInfo"%>
<%@page import="com.gopay.common.constants.trans.PayChannel"%>
<%@page import="com.gopay.cashier.domain.bean.PayChannelDtlBean"%>
<%@page import="com.gopay.common.constants.trans.PayChannelType"%>
<%@page import="com.gopay.cashier.domain.bean.PayChannelWayBean"%>
<%@ page import="java.util.List" %>
<script type="text/javascript" src="${ctx}/static/00100/javascripts/gopay/express/cardDialog.js"></script>
<%
    PayChannelWayBean pw=(PayChannelWayBean)request.getAttribute("payWayBean");
    PayChannelDtlBean pcb = pw.getPayChannelDtl(PayChannelType.FAST_PAY.value);
    List<PayChannelDtlInfo> creditBanks = pcb.getBankCodes().get(PayChannel._06.value);
    List<PayChannelDtlInfo> debitBanks =  pcb.getBankCodes().get(PayChannel._03.value);
    int cbankNums = creditBanks==null?0:creditBanks.size();
    int dbankNums = debitBanks==null?0:debitBanks.size();
%>
<c:set var="cbankNum" value="<%=cbankNums %>"/>
<c:set var="dbankNum" value="<%=dbankNums %>"/>
<script>
<%
    for(int i=0; i<cbankNums; i++){
        String bc = creditBanks.get(i).getOutStlmId();
%>
    creditCardArray.push('<%=bc%>');
<%}%>

<%
for(int i=0; i<dbankNums; i++){
    String bc = debitBanks.get(i).getOutStlmId();
%>
    debitCardArray.push('<%=bc%>');
<%}%>

</script>
<div id="expressBankListDialog" title="支持银行列表">
    <table class="table-tml marginTop10 marginBottom0">
        <tbody>
        <tr>
            <th>银行类型：</th>
            <td>
                <c:if test='${cbankNum gt 0}'>
                    <input type="radio" class="marginRight10" id="creditPayChannel" name="expressPayChannel" value="06" checked/><label class="marginRight40 font16 color-333" for="creditPayChannel" style="cursor: pointer;">信用卡</label>
                </c:if>
                <c:if test='${dbankNum gt 0}'>
                    <input type="radio" class="marginRight10" id="debitPayChannel" name="expressPayChannel" value="03"/><label class="font16 color-333" for="debitPayChannel" style="cursor: pointer;">储蓄卡</label>
                </c:if>
            </td>
        </tr>
        </tbody>
    </table>
    <c:if test='${cbankNum gt 0}'>
        <div class="bank-list-2 fix" id="creditBankList">
            <%
                //输出信用卡银行的图标
                for(int i=0; i<cbankNums; i++){
                    PayChannelDtlInfo info = creditBanks.get(i);
                    String bc = info.getOutStlmId();
                    out.print("<div class='items'>\n");
                    out.print("<label for='c_"+i+"' onclick=expressBankSel('c_"+i+"',this);>\n");
                    out.print("<img disabled='disabled'  height='40' border='0' src='"+request.getContextPath()+"/BankIcon/"+bc+".jpeg'  alt='"+bc+"' style='cursor:pointer'/>\n");
                    out.print("</label>\n");
                    out.print("<input type='radio' id='c_"+i+"' name='creditPayBankCode' value='"+bc+"' onclick=expressBankSel(\'c_"+i+"\',this);>\n");
                    out.print("</div>\n");
                }
            %>
        </div>
    </c:if>

    <c:if test='${dbankNum gt 0}'>
        <div class="bank-list-2 fix" id="debitBankList" style="display: none">
            <%
                //输出借记卡银行的图标
                for(int i=0; i<dbankNums; i++){
                    PayChannelDtlInfo info = debitBanks.get(i);
                    String bc = info.getOutStlmId();
                    out.print("<div class='items'>\n");
                    out.print("<label for='d_"+i+"' onclick=expressBankSel('d_"+i+"',this);>\n");
                    out.print("<img disabled='disabled'  height='40' border='0' src='"+request.getContextPath()+"/BankIcon/"+bc+".jpeg'  alt='"+bc+"' style='cursor:pointer'/>\n");
                    out.print("</label>\n");
                    out.print("<input type='radio' id='d_"+i+"' name='debitPayBankCode' value='"+bc+"'  onclick=expressBankSel(\'d_"+i+"\',this);>\n");
                    out.print("</div>\n");
                }
            %>
        </div>
    </c:if>

</div>


<div id="expressBankListDialog2" title="支持银行列表">
    <table class="table-tml marginTop10 marginBottom0">
        <tbody>
        <tr>
            <th>银行类型：</th>
            <td>
                <c:if test='${cbankNum gt 0}'>
                    <input type="radio" class="marginRight10" id="creditPayChannel2" name="expressPayChannel2" value="06" checked/><label class="marginRight40 font16 color-333" for="creditPayChannel2" style="cursor: pointer;">信用卡</label>
                </c:if>
                <c:if test='${dbankNum gt 0}'>
                    <input type="radio" class="marginRight10" id="debitPayChannel2" name="expressPayChannel2" value="03"/><label class="font16 color-333" for="debitPayChannel2" style="cursor: pointer;">储蓄卡</label>
                </c:if>
            </td>
        </tr>
        </tbody>
    </table>
    <c:if test='${cbankNum gt 0}'>
        <div class="bank-list-3 fix" id="creditBankList2">
            <%
                //输出信用卡银行的图标
                for(int i=0; i<cbankNums; i++){
                    PayChannelDtlInfo info = creditBanks.get(i);
                    String bc = info.getOutStlmId();
                    out.print("<div class='items'>\n");
//                    out.print("<label for='c_"+i+"' onclick=expressBankSel('c_"+i+"',this);>\n");
                    out.print("<img disabled='disabled'  height='40' border='0' src='"+request.getContextPath()+"/BankIcon/"+bc+".jpeg'  alt='"+bc+"' style='cursor:pointer'/>\n");
//                    out.print("</label>\n");
//                    out.print("<input type='radio' id='c_"+i+"' name='creditPayBankCode' value='"+bc+"'/>\n");
                    out.print("</div>\n");
                }
            %>
        </div>
    </c:if>

    <c:if test='${dbankNum gt 0}'>
        <div class="bank-list-3 fix" id="debitBankList2" style="display: none">
            <%
                //输出借记卡银行的图标
                for(int i=0; i<dbankNums; i++){
                    PayChannelDtlInfo info = debitBanks.get(i);
                    String bc = info.getOutStlmId();
                    out.print("<div class='items'>\n");
//                    out.print("<label for='d_"+i+"' onclick=expressBankSel('d_"+i+"',this);>\n");
                    out.print("<img disabled='disabled'  height='40' border='0' src='"+request.getContextPath()+"/BankIcon/"+bc+".jpeg'  alt='"+bc+"' style='cursor:pointer'/>\n");
//                    out.print("</label>\n");
//                    out.print("<input type='radio' id='d_"+i+"' name='debitPayBankCode' value='"+bc+"'/>\n");
                    out.print("</div>\n");
                }
            %>
        </div>
    </c:if>

</div>